You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Dew.Math.Units Namespace > Classes > Optimization Class > Optimization Methods > Optimization.CPA Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Optimization.CPA Method

Gomory's cutting plane algorithm for solving the integer programming problem.

Syntax
C#
Visual Basic
public static double CPA([In] TMtx A, [In] TVec b, [In] TVec c, [In] TMtx AFinal, [In] TVec X, [In] TVecInt Indexes, out TLPSolution SolutionType, bool Minimize, [In] TStrings Verbose);

Implements the Gomory's Cutting Plane Algorithm (CPA) for solwing the following linear programming problem 

 

with decision variables being restricted to integer values. 

Optionally, you can also assign TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring.

Minimize the following linear programming problem: 

f(x)=x1-3x2 (x1,x2 integers) 

 

x1-x2=2 

2x1+4x2=15 

which translates to:

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples { private void Example() { Matrix A = new Matrix(0,0); Matrix AFinal = new Matrix(0,0); Vector b = new Vector(0); Vector c = new Vector(0); Vector x = new Vector(0); Vector indexes = new Vector(0); TLPSolution sol; A.SetIt(2,2,false,new double[] {1,-1,2,4}); b.SetIt(new double[] {2,15}); c.SetIt(new double[] {1,-3}); double f = Optimization.CPA(A,b,c,AFinal,x,indexes, out sol, true,null); // f = -9.0 // x1=0, x2=3 } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!